The present invention relates to a car sensing apparatus incorporated in an automatically running system and a running assistance system, which is capable of avoiding other cars running ahead of a car, and following other cars running ahead of the cars, and a method for sensing the same.
An example of a conventional car sensing apparatus is disclosed in Japanese Patent Laid-open No. Heisei 3-83474. As shown in FIG. 6, the conventional car sensing apparatus 102 comprises a spatial differential unit 104; a comparison unit 106; a gate unit 108; a histogram measuring unit 110; a straight line edge extracting unit 112 and a decision unit 114. The conventional car sensing apparatus 102 analyzes a spatial differential value, and when portions which exhibit crowded spatial differential values directing the same direction, e.g., a vertical direction, that is, portions where edges of images in the same direction are crowded on a screen, exist while making a pair with a proper interval therebetween, this car sensing apparatus 102 decides that the car exists.
Specifically, the photographed image by a photography unit 116 is differentiated by the spatial differential unit 104, and an absolute value of the differentiated value is calculated for each pixel. The comparison unit 106 compares the differential absolute value, which was obtained for each pixel, With a set value, and the gate unit 108 selects the differential absolute value larger than the set value among them, thus outputting a differential direction code.
The histogram measuring unit 110 creates a histogram for each differential direction based on the differential direction code. The straight line edge extracting unit 112 extracts the distribution of the pixels With regard to the differential direction code based on the histogram created. The decision unit 118 decides that the car exists in the image photographed by the photograph unit when the distribution of the differential direction code forms two peaks.
As described above, since in the conventional car sensing apparatus 102 of such kind, the existence of the car is decided depending on whether the distribution of the differential direction code forms the two peaks, it is a fundamental requirement that the distribution of the differential direction code can be obtained distinctly. Many clear edges must be contained in the image for the sake of acquiring a clear distribution.
Under conditions that only an input image with poor contrast cannot be obtained, such as bad weather and photographing against the light, since an edge of the image becomes unclear and the number of edges to be extracted is small, the distribution of the differential direction code becomes unclear. Accordingly, it is difficult to discriminate whether two peaks are formed from such histogram or not, so that decision of existence of the car becomes inevitably inaccurate.
The present invention was invented to solve the above described problems, the object of the present invention is to provide a car sensing apparatus which is capable of accurately sensing a car even when only an image with poor contrast cannot be obtained under conditions such as bad weather and photographing against the light, and a method for sensing a car.
To solve the above described problems, a method for sensing a car comprises: an image inputting step for photographing an object and generating image data of the object; an edge line segment extracting step for extracting horizontal edge line segments and vertical edge line segments which are included in an image by the image data, based on the image data generated in the image inputting step; a line segment pair extracting step for extracting a pair of vertical edge line segments among the vertical edge line segments extracted in the edge segment extracting step, horizontal and vertical distances between the vertical edge line segments forming a pair satisfying reference conditions relating to a car height and a car width; a line segment pair evaluation value calculating step for selecting horizontal edge line segments existing between the vertical edge line segments forming the pair in a horizontal direction, among the horizontal edge line segments extracted in the edge line segment extracting step, for each vertical edge line segment extracted in the line segment pair extracting step, and, based on the number of the selected horizontal edge line segments, positions of the selected horizontal edge line segments and lengths of the selected edge line segments, calculating an evaluation value relating to a possibility that the vertical edge line segments forming the pair may be line segments expressing both side end portions of the car; and a decision step for comparing a reference value with the evaluation value calculated in the line segment pair evaluation value calculating step and deciding whether or not the vertical edge line segments forming the pair are line segments expressing the both side end portions of the car.
A car sensing apparatus of the present invention comprises: image inputting means for photographing an object and generating image data of the object; edge line segment extracting means for extracting horizontal edge line segments and vertical edge line segments which are included in an image by the image data, based on the image data generated by the image inputting means; line segment pair extracting means for extracting a pair of vertical edge line segments among the vertical edge line segments extracted by the edge line segment extracting means, horizontal and vertical distances between the vertical edge line segments forming the pair satisfying reference conditions relating to a car height and a car width; line segment pair evaluation value calculating means for selecting horizontal edge line segments existing between the vertical edge line segments forming the pair in a horizontal direction, among the horizontal edge line segments extracted by the edge line segment extracting means, for each vertical edge line segment pair extracted by the line segment pair extracting means, and, based on the number of the selected horizontal edge line segments, positions of the selected horizontal edge line segments and lengths of the selected edge line segments, calculating an evaluation value relating to a possibility that the vertical edge line segments forming the pair may be line segments expressing both side end portions of the car; and a decision means for comparing a reference value with the evaluation value calculated by the line segment pair evaluation value calculating means and deciding whether or not the vertical edge line segments forming the pair are line segments expressing the both side end portions of the car.